#pragma once

#include "assert.h"
#include <iostream>
#include <string>

#include "problem_factory.h"
#include "cnf_sat_solver.h"

namespace solver
{
	class unit_tests
	{

	public:

		static int test_fill_array_counter( int *arrayi, int count )
		{
			int c = 0; 
			while(c < count) 
			{
				arrayi[c] = c;
				c++;
			}
			return c;
		}

		static int test_fill_array_ptr( int *arrayi, int count )
		{
			int c = 0;
			int *endarrayi = arrayi + count;
			while (arrayi != endarrayi)
			{
				*arrayi = c;
				arrayi++;
				c++;
			}
			return c;
		}

		static void test_fill_array_stl_auto(std::vector<int>& test)
		{
			int c = 0;
			for (auto& v : test)
			{
				v = c;
				c++;
			}
		}

		static void test_fill_array_stl_iter(std::vector<int>& test)
		{
			int c = 0;
			for (auto& vi = test.begin(); vi != std::end( test ); vi++)
			{
				*vi = c;
				c++;
			}
		}

		static void test_fill_array_stl_index(std::vector<int>& test)
		{
			int count = test.size();
			int c = 0;
			while (c < count)
			{
				test[c] = c;
				c++;
			}
		}

		static int examine_arrays()
		{
			std::vector<int> testvv(10);
			int testv1[10], testv2[10];
			int result = 0;
			result += test_fill_array_counter(testv1, sizeof(testv1)/sizeof(int));
			result += test_fill_array_ptr(testv2, sizeof(testv2) / sizeof(int));
			test_fill_array_stl_auto(testvv);
			test_fill_array_stl_iter(testvv);
			test_fill_array_stl_index(testvv);
			return result;
		}

	};
}

